#!/bin/sh
publish_name=$1
publish_uri=$2
publish_directory=$3
num_posts=$4
uri_root=$5
uri_path=$6
username=$7
password=$8

# assumes svn and xsltproc are in /usr/bin (usually are)
/usr/bin/svn log $uri_root$uri_path --verbose --xml --limit $num_posts --username $username --password $password > $publish_directory/tmp/$publish_name.xml
/usr/bin/xsltproc --stringparam 'uri_root' "$uri_root" --stringparam 'uri_path' "$uri_path" --stringparam 'publish_name' "$publish_name" --stringparam 'publish_uri' "$publish_uri" $publish_directory/svn2atom.xslt $publish_directory/tmp/$publish_name.xml > $publish_directory/output/$publish_name.xml
rm $publish_directory/tmp/$publish_name.xml